﻿using System;
using Microsoft.BusinessData.MetadataModel;
using Microsoft.BusinessData.MetadataModel.Collections;

namespace BdcRestConnector.Tests
{
    public class MyTypeDescriptor : ITypeDescriptor
    {
        private readonly bool _isCollection;
        private readonly ITypeDescriptorCollection _children;
        private readonly INamedPropertyDictionary _properties;
        private readonly string _typeName;
        private readonly string _name;

        public MyTypeDescriptor(string name, string typeName, INamedPropertyDictionary properties,
            bool isCollection, ITypeDescriptorCollection children)
        {
            _isCollection = isCollection;
            _children = children;
            _properties = properties;
            _typeName = typeName;
            _name = name;
        }

        public bool ContainsFilterDescriptor
        {
            get { throw new NotImplementedException(); }
        }

        public bool ContainsIdentifier
        {
            get { throw new NotImplementedException(); }
        }

        public bool ContainsReadOnly
        {
            get { throw new NotImplementedException(); }
        }

        public TypeDescriptorFlags Flags
        {
            get { throw new NotImplementedException(); }
        }

        public IAssociation GetAssociation()
        {
            throw new NotImplementedException();
        }

        public ITypeDescriptorCollection GetChildTypeDescriptors()
        {
            return _children;
        }

        public IFilterDescriptor GetFilterDescriptor()
        {
            throw new NotImplementedException();
        }

        public IIdentifier GetIdentifier()
        {
            throw new NotImplementedException();
        }

        public IParameter GetParameter()
        {
            throw new NotImplementedException();
        }

        public ITypeDescriptor GetParentTypeDescriptor()
        {
            throw new NotImplementedException();
        }

        public string InterpretedTypeName
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsAssociationSet
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsCollection
        {
            get { return _isCollection; }
        }

        public bool IsFilterDescriptorSet
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsIdentifierSet
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsLeaf()
        {
            throw new NotImplementedException();
        }

        public bool IsReadOnly
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsRoot()
        {
            throw new NotImplementedException();
        }

        public string LobName
        {
            get { throw new NotImplementedException(); }
        }

        public bool TryGetDefaultValue(IMethodInstance forMethodInstance, out object value)
        {
            throw new NotImplementedException();
        }

        public string TypeName
        {
            get { return _typeName; }
        }

        public bool ContainsLocalizedDisplayName()
        {
            throw new NotImplementedException();
        }

        public string GetDefaultDisplayName()
        {
            throw new NotImplementedException();
        }

        public string GetLocalizedDisplayName()
        {
            throw new NotImplementedException();
        }

        public Microsoft.BusinessData.MetadataModel.Collections.ILocalizedNameDictionary GetLocalizedNames()
        {
            throw new NotImplementedException();
        }

        public Microsoft.BusinessData.MetadataModel.Collections.INamedPropertyDictionary GetProperties()
        {
            return _properties;
        }

        public long Id
        {
            get { throw new NotImplementedException(); }
        }

        public bool IsCached
        {
            get { throw new NotImplementedException(); }
        }

        public string Name
        {
            get { return _name; }
        }
    }
}
